<?php
include "conn.php";
$tiaojian = $_POST['tiaojian'];
$main = new main();
if ($tiaojian==1){
    $one = $_POST['one'];
    $two = $_POST['two'];
    $result = $main->jie($one,$two,$tiaojian,0,0);
}else if ($tiaojian == 2){
    $one = $_POST['one'];
    $two = $_POST['two'];
    $jietime = strtotime($_POST['jietime']) ;
    $backtime = strtotime($_POST['backtime'])+86399;
    $result = $main->jie($one,$two,$tiaojian,$jietime,$backtime);
}else if ($tiaojian == 3){
    $jietime = strtotime($_POST['jietime']) ;
    $backtime = strtotime($_POST['backtime'])+86399;
    $result = $main->jie(1,1,$tiaojian,$jietime,$backtime);
}
else{
    $result = $main->jie(1,1,$tiaojian,0,0);
}

echo json_encode($result);
